
let lunarCalendar = Object.create(null) ;

let heavenlyStemsDescriptor = {
    value: [ '甲' , '乙' , '丙' , '丁' , '戊' ,'己' , '庚' , '辛' , '壬' , '癸' ] ,
    writable: false ,
    enumerable: false ,
    configurable: false
}

// 为 lunarCalendar 实例定义一个 heavenlyStems 属性
Object.defineProperty( lunarCalendar , 'heavenlyStems' , heavenlyStemsDescriptor );

let earthlyBranchesDescriptor = {
    value: ['子','丑','寅','卯','辰','巳','午','未','申','酉','戌','亥' ]
}

Object.defineProperty( lunarCalendar , 'earthlyBranches' , earthlyBranchesDescriptor );


// lunarCalendar.showYears = function(){ console.log( '甲子' );}

let showYearsDescriptor = {
    value: function(){
        let s = '' ;
        for( let i = 0 ; i < 60 ; i++ ){
            let h = i % lunarCalendar.heavenlyStems.length ; 
            let e = i % lunarCalendar.earthlyBranches.length ;
            // console.log( h , e );
            let hs = lunarCalendar.heavenlyStems[ h ];
            let eb = lunarCalendar.earthlyBranches[ e ] ;
            // console.log( hs , eb );
            let he = hs + eb ;
            // console.log( he );
            s = s + he + ( e == 11 ? '\n' : '\t' ) ;
        }
        console.log( s );
    }
}

Object.defineProperty( lunarCalendar , 'showYears' , showYearsDescriptor );

lunarCalendar.showYears();